package org.blueoxygen.kukuruyuk.actions.location;
import java.util.ArrayList;
import java.util.List;
import org.blueoxygen.cimande.persistence.PersistenceAware;
import org.blueoxygen.cimande.persistence.PersistenceManager;
import org.blueoxygen.cimande.security.SessionCredentials;
import org.blueoxygen.cimande.security.SessionCredentialsAware;
import org.blueoxygen.kukuruyuk.entity.Location;

import com.opensymphony.xwork2.ActionSupport;
public class LocationForm extends ActionSupport
	implements PersistenceAware, SessionCredentialsAware {
	protected PersistenceManager manager;
	protected SessionCredentials sessionCredentials;
	private Location location = new Location();
	private List<Location> locations = new ArrayList<Location>();
	public String execute(){
		if(getLocation().getId() != null &&
				!"".equalsIgnoreCase(getLocation().getId().trim())){
				setLocation((Location) manager.getById(Location.class, getLocation().getId()));
		}
			return SUCCESS;
		}
		public void setPersistenceManager(PersistenceManager persistenceManager){
			this.manager = persistenceManager;
		}
		public void setSessionCredentials(SessionCredentials sessionCredentials){
			this. sessionCredentials = sessionCredentials;
		}
		public Location getLocation() {
			return location;
		}
		public void setLocation(Location location) {
			this.location = location;
		}
		public List<Location> getLocations() {
			return locations;
		}
		public void setLocations(List<Location> locations) {
			this.locations = locations;
		}
		
}

